package com.leather.market.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leather.common.entity.GoodsType;
import com.leather.common.result.CodeMsg;
import com.leather.common.result.Result;
import com.leather.common.toolkits.CheckKit;
import com.leather.market.mapper.GoodsTypeMapper;
import com.leather.market.service.GoodsTypeService;
import org.springframework.stereotype.Service;

@Service
public class GoodsTypeServiceImpl extends ServiceImpl<GoodsTypeMapper, GoodsType> implements GoodsTypeService {

    @Override
    public Result addGoodsType(GoodsType goodsType) {
        CheckKit.notEmpty(goodsType.getGoodsTypeName(), CodeMsg.EMPTY_GOODSTYPE_NAME);
        CheckKit.check(save(goodsType),CodeMsg.SERVER_ERROR);
        return Result.success("ok");
    }

}
